package com.example.administrator.compileapp.drawer;

import android.databinding.DataBindingUtil;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Toast;

import com.example.administrator.compileapp.R;
import com.example.administrator.compileapp.databinding.ActivityFeedbackBinding;

public class FeedBackActivity extends AppCompatActivity implements View.OnClickListener {
  private ActivityFeedbackBinding binding;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding= DataBindingUtil.setContentView(this,R.layout.activity_feedback);
        init();
    }

    private void init() {
        binding.feedbackTitle.setText((getIntent().getStringExtra("logn")));
        binding.feedbackCommit.setOnClickListener(this);
        binding.feedbackBack.setOnClickListener(this);
       binding.feedbackB.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.feedback_commit:
            if(binding.feedbackEdit.getText().equals("")){
                Toast.makeText(this, "内容不能为空,请输入！", Toast.LENGTH_SHORT).show();
            }else{
                Toast.makeText(this, "感谢提交，谢谢！+"+binding.feedbackEdit.getText(), Toast.LENGTH_SHORT).show();
            }
            break;
            case R.id.feedback_back:
            case R.id.feedback_b:
                finish();
                break;
        }
    }
}
